import Vue from "vue";
import Vuex from "vuex";
import persistedState from "vuex-persistedstate";
import login from "./modules/login";
import user from "./modules/user";

Vue.use(Vuex);

export default new Vuex.Store({
  //默认情况下,只有state是独享的,其他都是VUEX全局共享的
  modules: {
    login,
    user
  },
  plugins: [
    //持久化
    persistedState({
      // storage: window.sessionStorage,
    })
  ]
});
